def create_adv_name_data(name="ESP32"):
    name_bytes = name.encode("utf-8")
    length_byte = (len(name_bytes) + 1).to_bytes(1, "little")
    return length_byte + b"\x09" + name_bytes


def get_ble_character_handler(services):
    (service_oled, service_gc, service_spp) = services
    (oled_text_char,) = service_oled
    (gc_alloc_char, gc_free_char) = service_gc
    (spp_char) = service_spp
    return {
        "oled_text_char": oled_text_char,
        "gc_alloc_char": gc_alloc_char,
        "gc_free_char": gc_free_char,
        "spp_char": spp_char,
    }
